﻿using ClassLibrary1;
using DependencyAnalysis.DataModel;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTests
{
    [TestClass]
    public class DetectDataObjectsTest : AnalyzerTestBase
    {
        [TestMethod]
        public void DetectPureDataObject()
        {
            var typeDescriptor = DescriptorBuilder.BuildTypeDescriptor(typeof(PureDataObject));
            Assert.IsTrue(typeDescriptor.IsDataObject);
        }

        [TestMethod]
        public void DetectDataObjectWithFewMethods()
        {
            var typeDescriptor = DescriptorBuilder.BuildTypeDescriptor(typeof(DataObjectWithFewMethods));
            Assert.IsTrue(typeDescriptor.IsDataObject);
        }

        [TestMethod]
        public void DetectClassObject()
        {
            var typeDescriptor = DescriptorBuilder.BuildTypeDescriptor(typeof(ClassObject));
            Assert.IsFalse(typeDescriptor.IsDataObject);
        }
    }
}
